package com.example.chat.pojo.vo;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * <p>
 * 用户实体
 * </p>
 *
 * @author 林邵晨
 * @since 2023-07-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class UserVO extends Model<UserVO> {

    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("性别")
    private Integer sex;

    @ApiModelProperty("头像")
    private String avatar;

    @ApiModelProperty("手机号")
    private String phone;

    @ApiModelProperty("用户唯一标识")
    private String cid;

    @ApiModelProperty("好友状态")
    private Integer state;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @ApiModelProperty("添加日期")
    private Date date;

    @ApiModelProperty("聊条类型")
    private Integer chatType;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @ApiModelProperty("聊天日期")
    private Date chatDate;

    @ApiModelProperty("新消息数，用于前端计数")
    private long count;

    @ApiModelProperty("会话最新消息")
    private String latestMessage;

    @ApiModelProperty("用户唯一标识")
    private String userId;

}
